﻿// Copyright (C) 2012 Angel Hernández Matos / Bonafide Ideas.
// You can redistribute this software and/or modify it under the terms of the 
// Microsoft Reciprocal License (Ms-RL).  This program is distributed in the hope 
// that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
// See License.txt for more details. 

/* C++ compiler      : Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
   Creation date     : 14/04/2012
   Developer         : Angel Hernández Matos
   e-m@il            : angel@bonafideideas.com 
 					 : angeljesus14@hotmail.com
   Website           : http://www.bonafideideas.com
*/

// File generated by Wsutil Compiler version 1.0092 

 #include "stdafx.h"
#include <WebServices.h>
#include "cybernanny2.xsd.h"
#include "cybernanny3.xsd.h"
#include "cybernanny0.xsd.h" 
#include "cybernannysvc.h"

typedef struct _cybernanny_wsdlLocalDefinitions 
{
    struct // messages
    {
        WS_MESSAGE_DESCRIPTION ICyberNanny_AddRequest_InputMessage;
        WS_MESSAGE_DESCRIPTION ICyberNanny_AddRequest_OutputMessage;
        WS_MESSAGE_DESCRIPTION ICyberNanny_RemoveRequest_InputMessage;
        WS_MESSAGE_DESCRIPTION ICyberNanny_RemoveRequest_OutputMessage;
    } messages; // end of messages
    struct // contracts
    {
        struct // BasicHttpBinding_ICyberNanny
        {
            struct // BasicHttpBinding_ICyberNanny_AddRequest
            {
                WS_PARAMETER_DESCRIPTION params[3];
                WS_OPERATION_DESCRIPTION BasicHttpBinding_ICyberNanny_AddRequest;
            } BasicHttpBinding_ICyberNanny_AddRequest;
            struct // BasicHttpBinding_ICyberNanny_RemoveRequest
            {
                WS_PARAMETER_DESCRIPTION params[4];
                WS_OPERATION_DESCRIPTION BasicHttpBinding_ICyberNanny_RemoveRequest;
            } BasicHttpBinding_ICyberNanny_RemoveRequest;
            WS_OPERATION_DESCRIPTION* operations[2];
            WS_CONTRACT_DESCRIPTION contractDesc;
        } BasicHttpBinding_ICyberNanny;
    } contracts;  // endof contracts 
    struct // policies
    {
        struct // BasicHttpBinding_ICyberNanny
        {
            WS_ENCODING encoding;
            WS_ADDRESSING_VERSION addressingVersion;
            WS_ENVELOPE_VERSION envelopeVersion;
            WS_CHANNEL_PROPERTY channelPropertiesArray[3];
        } BasicHttpBinding_ICyberNanny;
    } policies;
    struct // XML dictionary
    {
        struct // XML string list
        {
            WS_XML_STRING ICyberNanny_AddRequest_InputMessageactionName;  // http://tempuri.org/ICyberNanny/AddRequest
            WS_XML_STRING ICyberNanny_AddRequest_OutputMessageactionName;  // http://tempuri.org/ICyberNanny/AddRequestResponse
            WS_XML_STRING ICyberNanny_RemoveRequest_InputMessageactionName;  // http://tempuri.org/ICyberNanny/RemoveRequest
            WS_XML_STRING ICyberNanny_RemoveRequest_OutputMessageactionName;  // http://tempuri.org/ICyberNanny/RemoveRequestResponse
        } xmlStrings; // end of XML string list
        WS_XML_DICTIONARY dict;  
    } dictionary;  // end of XML dictionary
} _cybernanny_wsdlLocalDefinitions;


typedef struct BasicHttpBinding_ICyberNanny_AddRequestParamStruct 
{
    enum Common_RequestType* type;
    int* userIdentifier;
    WS_STRING* AddRequestResult;
} BasicHttpBinding_ICyberNanny_AddRequestParamStruct;

#if (_MSC_VER >=1400) 
#pragma warning(push)
#endif
#pragma warning(disable: 4055) // conversion from data pointer to function pointer
HRESULT CALLBACK BasicHttpBinding_ICyberNanny_AddRequestOperationStub(
    __in const WS_OPERATION_CONTEXT* _context,
    __in void* _stackStruct,
    __in const void* _callback,
    __in_opt const WS_ASYNC_CONTEXT* _asyncContext,
    __in_opt WS_ERROR* _error)
{
    BasicHttpBinding_ICyberNanny_AddRequestCallback _operation = (BasicHttpBinding_ICyberNanny_AddRequestCallback)_callback;
    BasicHttpBinding_ICyberNanny_AddRequestParamStruct *_stack =(BasicHttpBinding_ICyberNanny_AddRequestParamStruct*)_stackStruct;
    return _operation( 
        _context,
        *(_stack->type),
        *(_stack->userIdentifier),
        (_stack->AddRequestResult),
        (WS_ASYNC_CONTEXT*)_asyncContext,
        _error);
}
#pragma warning(default: 4055)  // conversion from data pointer to function pointer
#if (_MSC_VER >=1400) 
#pragma warning(pop)
#endif

typedef struct BasicHttpBinding_ICyberNanny_RemoveRequestParamStruct 
{
    int* userIdentifier;
    BOOL* removeAll;
    BOOL* RemoveRequestResult;
    StringBuilder** message;
} BasicHttpBinding_ICyberNanny_RemoveRequestParamStruct;

#if (_MSC_VER >=1400) 
#pragma warning(push)
#endif
#pragma warning(disable: 4055) // conversion from data pointer to function pointer
HRESULT CALLBACK BasicHttpBinding_ICyberNanny_RemoveRequestOperationStub(
    __in const WS_OPERATION_CONTEXT* _context,
    __in void* _stackStruct,
    __in const void* _callback,
    __in_opt const WS_ASYNC_CONTEXT* _asyncContext,
    __in_opt WS_ERROR* _error)
{
    BasicHttpBinding_ICyberNanny_RemoveRequestCallback _operation = (BasicHttpBinding_ICyberNanny_RemoveRequestCallback)_callback;
    BasicHttpBinding_ICyberNanny_RemoveRequestParamStruct *_stack =(BasicHttpBinding_ICyberNanny_RemoveRequestParamStruct*)_stackStruct;
    return _operation( 
        _context,
        *(_stack->userIdentifier),
        *(_stack->removeAll),
        (_stack->RemoveRequestResult),
        (_stack->message),
        (WS_ASYNC_CONTEXT*)_asyncContext,
        _error);
}
#pragma warning(default: 4055)  // conversion from data pointer to function pointer
#if (_MSC_VER >=1400) 
#pragma warning(pop)
#endif
const static _cybernanny_wsdlLocalDefinitions cybernanny_wsdlLocalDefinitions =
{
    { // messages
        {    // message description for ICyberNanny_AddRequest_InputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_AddRequest_InputMessageactionName, // http://tempuri.org/ICyberNanny/AddRequest
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.AddRequest, 
        },    // message description for ICyberNanny_AddRequest_InputMessage
        {    // message description for ICyberNanny_AddRequest_OutputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_AddRequest_OutputMessageactionName, // http://tempuri.org/ICyberNanny/AddRequestResponse
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.AddRequestResponse, 
        },    // message description for ICyberNanny_AddRequest_OutputMessage
        {    // message description for ICyberNanny_RemoveRequest_InputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_RemoveRequest_InputMessageactionName, // http://tempuri.org/ICyberNanny/RemoveRequest
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.RemoveRequest, 
        },    // message description for ICyberNanny_RemoveRequest_InputMessage
        {    // message description for ICyberNanny_RemoveRequest_OutputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_RemoveRequest_OutputMessageactionName, // http://tempuri.org/ICyberNanny/RemoveRequestResponse
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.RemoveRequestResponse, 
        },    // message description for ICyberNanny_RemoveRequest_OutputMessage
    }, // end of messages 
    { // contracts
        {    // BasicHttpBinding_ICyberNanny,
            { // BasicHttpBinding_ICyberNanny_AddRequest
                { // parameter descriptions for BasicHttpBinding_ICyberNanny_AddRequest
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)0, (USHORT)-1 },
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)1, (USHORT)-1 },
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)-1, (USHORT)0 },
                },    // parameter descriptions for BasicHttpBinding_ICyberNanny_AddRequest
                {    // operation description for BasicHttpBinding_ICyberNanny_AddRequest
                    1,
                    (WS_MESSAGE_DESCRIPTION*)&cybernanny_wsdl.messages.ICyberNanny_AddRequest_InputMessage, 
                    (WS_MESSAGE_DESCRIPTION*)&cybernanny_wsdl.messages.ICyberNanny_AddRequest_OutputMessage, 
                    0,
                    0,
                    3,
                    (WS_PARAMETER_DESCRIPTION*)cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.BasicHttpBinding_ICyberNanny_AddRequest.params,
                    BasicHttpBinding_ICyberNanny_AddRequestOperationStub,
                    WS_NON_RPC_LITERAL_OPERATION
                }, //operation description for BasicHttpBinding_ICyberNanny_AddRequest
            },  // BasicHttpBinding_ICyberNanny_AddRequest
            { // BasicHttpBinding_ICyberNanny_RemoveRequest
                { // parameter descriptions for BasicHttpBinding_ICyberNanny_RemoveRequest
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)0, (USHORT)-1 },
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)1, (USHORT)-1 },
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)-1, (USHORT)0 },
                    { WS_PARAMETER_TYPE_NORMAL, (USHORT)-1, (USHORT)1 },
                },    // parameter descriptions for BasicHttpBinding_ICyberNanny_RemoveRequest
                {    // operation description for BasicHttpBinding_ICyberNanny_RemoveRequest
                    1,
                    (WS_MESSAGE_DESCRIPTION*)&cybernanny_wsdl.messages.ICyberNanny_RemoveRequest_InputMessage, 
                    (WS_MESSAGE_DESCRIPTION*)&cybernanny_wsdl.messages.ICyberNanny_RemoveRequest_OutputMessage, 
                    0,
                    0,
                    4,
                    (WS_PARAMETER_DESCRIPTION*)cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.BasicHttpBinding_ICyberNanny_RemoveRequest.params,
                    BasicHttpBinding_ICyberNanny_RemoveRequestOperationStub,
                    WS_NON_RPC_LITERAL_OPERATION
                }, //operation description for BasicHttpBinding_ICyberNanny_RemoveRequest
            },  // BasicHttpBinding_ICyberNanny_RemoveRequest
            {    // array of operations for BasicHttpBinding_ICyberNanny
                (WS_OPERATION_DESCRIPTION*)&cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.BasicHttpBinding_ICyberNanny_AddRequest.BasicHttpBinding_ICyberNanny_AddRequest,
                (WS_OPERATION_DESCRIPTION*)&cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.BasicHttpBinding_ICyberNanny_RemoveRequest.BasicHttpBinding_ICyberNanny_RemoveRequest,
            },    // array of operations for BasicHttpBinding_ICyberNanny
            {    // contract description for BasicHttpBinding_ICyberNanny
            2,
            (WS_OPERATION_DESCRIPTION**)cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.operations,
            },  // end of contract description for BasicHttpBinding_ICyberNanny
        },    // BasicHttpBinding_ICyberNanny
    }, //  end of contracts 
    {// policies
        {
            WS_ENCODING_XML_UTF8,
            WS_ADDRESSING_VERSION_TRANSPORT,
            WS_ENVELOPE_VERSION_SOAP_1_1,
            { // channelPropertiesArray
                {
                    WS_CHANNEL_PROPERTY_ENCODING,
                    (void*)&cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.encoding,
                    sizeof(cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.encoding),
                },
                {
                    WS_CHANNEL_PROPERTY_ADDRESSING_VERSION,
                    (void*)&cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.addressingVersion,
                    sizeof(cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.addressingVersion),
                },
                {
                    WS_CHANNEL_PROPERTY_ENVELOPE_VERSION,
                    (void*)&cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.envelopeVersion,
                    sizeof(cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.envelopeVersion),
                },
            },
        },   // end of BasicHttpBinding_ICyberNanny,
    }, // policies
    {    // dictionary 
        { // xmlStrings
            WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/ICyberNanny/AddRequest",&cybernanny_wsdlLocalDefinitions.dictionary.dict, 0),
            WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/ICyberNanny/AddRequestResponse",&cybernanny_wsdlLocalDefinitions.dictionary.dict, 1),
            WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/ICyberNanny/RemoveRequest",&cybernanny_wsdlLocalDefinitions.dictionary.dict, 2),
            WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/ICyberNanny/RemoveRequestResponse",&cybernanny_wsdlLocalDefinitions.dictionary.dict, 3),
        },  // end of xmlStrings
        
        {   // cybernanny_wsdldictionary
        // d168179a-0dac-46ab-a477-5d17a86eaa61 
        { 0xd168179a, 0x0dac, 0x46ab, { 0xa4, 0x77, 0x5d,0x17, 0xa8, 0x6e, 0xaa, 0x61 } },
        (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings,
        4,
        TRUE,
        },
    },   //  end of dictionary
}; //  end of cybernanny_wsdlLocalDefinitions


// operation: BasicHttpBinding_ICyberNanny_AddRequest
HRESULT WINAPI BasicHttpBinding_ICyberNanny_AddRequest(
    __in WS_SERVICE_PROXY* _serviceProxy,
    __in enum Common_RequestType type, 
    __in int userIdentifier, 
    __out WS_STRING* AddRequestResult, 
    __in WS_HEAP* _heap,
    __in_ecount_opt(_callPropertyCount) const WS_CALL_PROPERTY* _callProperties,
    __in const ULONG _callPropertyCount,
    __in_opt const WS_ASYNC_CONTEXT* _asyncContext,
    __in_opt WS_ERROR* _error)
{
    void* _argList[3]; 
    _argList[0] = &type;
    _argList[1] = &userIdentifier;
    _argList[2] = &AddRequestResult;
    return WsCall(_serviceProxy,
        (WS_OPERATION_DESCRIPTION*)&cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.BasicHttpBinding_ICyberNanny_AddRequest.BasicHttpBinding_ICyberNanny_AddRequest,
        (const void **)&_argList,
        _heap,
        _callProperties,
        _callPropertyCount,
        _asyncContext,
        _error);
}

// operation: BasicHttpBinding_ICyberNanny_RemoveRequest
HRESULT WINAPI BasicHttpBinding_ICyberNanny_RemoveRequest(
    __in WS_SERVICE_PROXY* _serviceProxy,
    __in int userIdentifier, 
    __in BOOL removeAll, 
    __out BOOL* RemoveRequestResult, 
    __deref_out_opt StringBuilder** message, 
    __in WS_HEAP* _heap,
    __in_ecount_opt(_callPropertyCount) const WS_CALL_PROPERTY* _callProperties,
    __in const ULONG _callPropertyCount,
    __in_opt const WS_ASYNC_CONTEXT* _asyncContext,
    __in_opt WS_ERROR* _error)
{
    void* _argList[4]; 
    _argList[0] = &userIdentifier;
    _argList[1] = &removeAll;
    _argList[2] = &RemoveRequestResult;
    _argList[3] = &message;
    return WsCall(_serviceProxy,
        (WS_OPERATION_DESCRIPTION*)&cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.BasicHttpBinding_ICyberNanny_RemoveRequest.BasicHttpBinding_ICyberNanny_RemoveRequest,
        (const void **)&_argList,
        _heap,
        _callProperties,
        _callPropertyCount,
        _asyncContext,
        _error);
}
const _cybernanny_wsdl cybernanny_wsdl =
{
    {// messages
        {    // message description for ICyberNanny_AddRequest_InputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_AddRequest_InputMessageactionName, // http://tempuri.org/ICyberNanny/AddRequest
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.AddRequest, 
        },    // message description for ICyberNanny_AddRequest_InputMessage
        {    // message description for ICyberNanny_AddRequest_OutputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_AddRequest_OutputMessageactionName, // http://tempuri.org/ICyberNanny/AddRequestResponse
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.AddRequestResponse, 
        },    // message description for ICyberNanny_AddRequest_OutputMessage
        {    // message description for ICyberNanny_RemoveRequest_InputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_RemoveRequest_InputMessageactionName, // http://tempuri.org/ICyberNanny/RemoveRequest
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.RemoveRequest, 
        },    // message description for ICyberNanny_RemoveRequest_InputMessage
        {    // message description for ICyberNanny_RemoveRequest_OutputMessage
            (WS_XML_STRING*)&cybernanny_wsdlLocalDefinitions.dictionary.xmlStrings.ICyberNanny_RemoveRequest_OutputMessageactionName, // http://tempuri.org/ICyberNanny/RemoveRequestResponse
            (WS_ELEMENT_DESCRIPTION*)&cybernanny0_xsd.globalElements.RemoveRequestResponse, 
        },    // message description for ICyberNanny_RemoveRequest_OutputMessage
    }, // messages
    {// contracts
        {   // BasicHttpBinding_ICyberNanny
            2,
            (WS_OPERATION_DESCRIPTION**)cybernanny_wsdlLocalDefinitions.contracts.BasicHttpBinding_ICyberNanny.operations,
        },    // end of BasicHttpBinding_ICyberNanny
    }, // contracts
    { // policies
        {  // template description for BasicHttpBinding_ICyberNanny
            {  // channel properties
                (WS_CHANNEL_PROPERTY*)&cybernanny_wsdlLocalDefinitions.policies.BasicHttpBinding_ICyberNanny.channelPropertiesArray,
                3,
            },
        },  // end of template description
    },  // policies
}; // end of _cybernanny_wsdl

HRESULT BasicHttpBinding_ICyberNanny_CreateServiceProxy(
    __in_opt WS_HTTP_BINDING_TEMPLATE* templateValue,
    __in_ecount_opt(proxyPropertyCount) const WS_PROXY_PROPERTY* proxyProperties,
    __in const ULONG proxyPropertyCount,
    __deref_out_opt WS_SERVICE_PROXY** _serviceProxy,
    __in_opt WS_ERROR* error)
{
    return WsCreateServiceProxyFromTemplate(
        WS_CHANNEL_TYPE_REQUEST,
        proxyProperties,
        proxyPropertyCount,
        WS_HTTP_BINDING_TEMPLATE_TYPE,
        templateValue,
        templateValue == NULL ? 0 : sizeof(WS_HTTP_BINDING_TEMPLATE),
        &cybernanny_wsdl.policies.BasicHttpBinding_ICyberNanny,
        sizeof(cybernanny_wsdl.policies.BasicHttpBinding_ICyberNanny),
        _serviceProxy,
        error);
}

HRESULT BasicHttpBinding_ICyberNanny_CreateServiceEndpoint(
    __in_opt WS_HTTP_BINDING_TEMPLATE* templateValue,
    __in_opt CONST WS_STRING* address,
    __in_opt struct BasicHttpBinding_ICyberNannyFunctionTable* functionTable,
    __in_opt WS_SERVICE_SECURITY_CALLBACK authorizationCallback,
    __in_ecount_opt(endpointPropertyCount) WS_SERVICE_ENDPOINT_PROPERTY* endpointProperties,
    __in const ULONG endpointPropertyCount,
    __in WS_HEAP* heap,
    __deref_out_opt WS_SERVICE_ENDPOINT** serviceEndpoint,
    __in_opt WS_ERROR* error)
{
    WS_SERVICE_CONTRACT serviceContract;
    serviceContract.contractDescription = &cybernanny_wsdl.contracts.BasicHttpBinding_ICyberNanny;
    serviceContract.defaultMessageHandlerCallback = 0;
    serviceContract.methodTable = (const void*)functionTable;
    
    return WsCreateServiceEndpointFromTemplate(
        WS_CHANNEL_TYPE_REPLY,
        endpointProperties,
        endpointPropertyCount,
        address,
        &serviceContract,
        authorizationCallback,
        heap,
        WS_HTTP_BINDING_TEMPLATE_TYPE,
        templateValue,
        templateValue == NULL ? 0 : sizeof(WS_HTTP_BINDING_TEMPLATE),
        &cybernanny_wsdl.policies.BasicHttpBinding_ICyberNanny,
        sizeof(cybernanny_wsdl.policies.BasicHttpBinding_ICyberNanny),
        serviceEndpoint,
        error);
}
